package com.xuanwei.admin.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xuanwei.core.entity.vo.UserListVo;
import com.xuanwei.core.response.ResultVO;
import com.xuanwei.core.service.IXwUserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author jiangyong
 * @Description TODO
 * @Date 2019/7/23 14:09
 **/
@RestController
@RequestMapping("api/user")
public class UserController extends BasicController {

    private IXwUserService userService;

    public UserController(IXwUserService userService) {
        this.userService = userService;
    }

    @RequestMapping("list.do")
    public ResultVO list(String nickname, String phone) {
        Page<UserListVo> page = userService.page(nickname, phone, getPage());

        return ResultVO.successResult(page);
    }
}
